#ifndef INSTRUCTION_H
#define INSTRUCTION_H
typedef enum
{
    VM_LOAD,
    VM_LOADNIL,
    VM_MOV,
    VM_QUEUE,
    VM_MAP,
    VM_GETV,
    VM_SETV,
    VM_POS,
    VM_NEG,
    VM_ADD,
    VM_SUB,
    VM_MUL,
    VM_DIV,
    VM_MOD,
    VM_POWER,
    VM_UNM,
    VM_NOT,
    VM_EQ,
    VM_NEQ,
    VM_LE,
    VM_LT,
    VM_AND,
    VM_OR,
    VM_JUMP,
    VM_GOTO,
    VM_CONCAT,
    VM_RETURN,
    VM_CLOSURE,
    VM_SELF,
    VM_CALL,
    VM_IMPORT,
    VM_GETUPVAL,
    VM_SETUPVAL,
    VM_LOOP,
    VM_ITERATOR,
    VM_PRINT,
} INSTRUCTION_CATEGORY;

static _byte *INSTRUCTION_CATEGORY_STRING[] = {
    "VM_LOAD",
    "VM_LOADNIL",
    "VM_MOV",
    "VM_QUEUE",
    "VM_MAP",
    "VM_GETV",
    "VM_SETV",
    "VM_POS",
    "VM_NEG",
    "VM_ADD",
    "VM_SUB",
    "VM_MUL",
    "VM_DIV",
    "VM_MOD",
    "VM_POWER",
    "VM_UNM",
    "VM_NOT",
    "VM_EQ",
    "VM_NEQ",
    "VM_LE",
    "VM_LT",
    "VM_AND",
    "VM_OR",
    "VM_JUMP",
    "VM_GOTO",
    "VM_CONCAT",
    "VM_RETURN",
    "VM_CLOSURE",
    "VM_SELF",
    "VM_CALL",
    "VM_IMPORT",
    "VM_GETUPVAL",
    "VM_SETUPVAL",
    "VM_LOOP",
    "VM_ITERATOR",
    "VM_PRINT",
};

typedef struct Instruction
{
    INSTRUCTION_CATEGORY category;
    _int args[3];
} Instruction;

#endif